package com.ruoyi.project.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.base.Field;
import com.ruoyi.project.service.impl.CostMatchDetail;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@ApiModel("出库销售表")
@TableName("project_customer")
public class ProjectCustom extends Field {
    /** 表id */
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(fill = FieldFill.INSERT)
    private Long id;

    /** 往来客户id */
    @Excel(name = "往来客户id")
    private String customerId;

    /** 往来客户名称 */
    @Excel(name = "往来客户名称")
    private String customerName;

    /** 出库起始日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出库起始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /** 出库截至日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出库截至日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /** 审核状态1未审核 2审核通过 3作废 */
    @Excel(name = "审核状态1未审核 2审核通过 3作废")
    private String status;

    /** 发起人id */
    @Excel(name = "发起人id")
    private Long promoterId;

    /** 发起人姓名 */
    @Excel(name = "发起人姓名")
    private String promoterName;

    private String remark;

    //审核备注
    private String auditRemark;

    /** 审核人id */
    @Excel(name = "审核人id")
    private Long auditId;

    /** 审核人姓名 */
    @Excel(name = "审核人姓名")
    private String auditName;

    /** 成本合计 */
    @Excel(name = "成本合计")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal costTotal;

    /** 销售总金额 */
    @Excel(name = "销售总金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal total;

    /** 毛利 */
    @Excel(name = "毛利")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal profit;

    /** 毛利率 */
    @Excel(name = "毛利率")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal profitRatio;

    @TableField(exist = false)
    private List<ProjectSale> saleList;


    private Long saleId;

    private String saleName;


    @Excel(name = "调平的金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal subAmount;

    //个人绩效总金额
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal personTotal;

    //部门绩效总金额
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal deptTotal;

    //个人已发放
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal personAlready;

    //个人待发放
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal personWait;

    //部门已发放
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal deptAlready;

    //部门待发放
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal deptWait;


    //个人本次发放金额
    @TableField(exist = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal personCurrent;

    //部门本次发放金额
    @TableField(exist = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal deptCurrent;



}
